﻿using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using Sungero.Domain.Initialization;

namespace akibank.MyCompany.Server
{
  public partial class ModuleInitializer
  {
    public override void Initializing(Sungero.Domain.ModuleInitializingEventArgs e)
    {
      GrantCreateRightsOnReferences();
    }
    /// <summary>
    /// Выдача прав на справочники.
    /// </summary>
    public static void GrantCreateRightsOnReferences()
    {
        var allUsers = Roles.AllUsers;
        Branches.AccessRights.Grant(allUsers, DefaultAccessRightsTypes.Read);
        Branches.AccessRights.Save();
    }
  }

}
